package com.design_patterns.demo;


import java.util.ArrayList;
import java.util.List;

public class doClass {

    private static doClass doclass = new doClass();

    private static List<String> sqlList = new ArrayList<>();

    private  doClass() {

    }

    public synchronized static void doSql() throws InterruptedException {
        for (String sql : sqlList) {
            Thread.sleep(1000);
            System.err.println(sql);
        }
    }

    public synchronized static void saveSql(List<String> sqlList1) {
        sqlList.addAll(sqlList1);
    }

    public static doClass getDoClass() {
        return doclass;
    }

}
